package cn.zwxky.android.staff.My;


import android.content.Context;
import android.view.View;

import com.zgscwjm.lsfbbasetemplate.Event.LsfbEvent;
import com.zgscwjm.lsfbbasetemplate.adapter.CommonAdapter;
import com.zgscwjm.lsfbbasetemplate.adapter.ViewHolder;

import java.util.List;

import cn.zwxky.android.staff.R;
import cn.zwxky.android.staff.Utils.URLString;

/**
 * Created by Administrator on 2017/4/6 0006.
 */

public class CompanyMsgAdapter extends CommonAdapter<CompanyMsgBean.ListBean> {

    public CompanyMsgAdapter(Context context, int layoutId, List<CompanyMsgBean.ListBean> list) {
        super(context, layoutId, list);
    }

    @Override
    public void convert(ViewHolder holder, final CompanyMsgBean.ListBean model) {
          holder.setImg(R.id.item_news_img, URLString.IMG_URL+model.getImg(),R.drawable.img_zhanwei);
          holder.setText(R.id.item_company_msg_text_title,model.getTitle());
          holder.setText(R.id.item_company_msg_text_time,model.getTimes());

        holder.setOnclick(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                NewsClickEvent even = new NewsClickEvent();
                even.setData(model.getUrl());
                LsfbEvent.getInstantiation().post(even);
            }
        });
    }
}
